﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CreateSelf : MonoBehaviour {

	public GameObject circleObj;

	private void Awake() 
	{
		/*for(int i = 0; i < 10; i++)
		{
			GameObject.Instantiate(circleObj);
		}*/
	}

	// Use this for initialization
	void Start () 
	{
		CreateCircleObjList();
/*		for(int i = 0; i < 10; i++)
		{
			GameObject.Instantiate(circleObj);
		}*/
	}

	void CreateCircleObjList()
	{
		for(int i = 0; i < 10; i++)
		{
			var newObj = GameObject.Instantiate(circleObj);
			newObj.transform.SetParent(circleObj.transform.parent);
			newObj.transform.SetPositionAndRotation(circleObj.transform.position + new Vector3(Random.Range(-200.0f, 200.0f), Random.Range(-30.0f, 30.0f), 0), circleObj.transform.rotation);
			newObj.transform.localScale = circleObj.transform.localScale;
		}
	}

	void CheckIsCountLowToGenerate()
	{

	}
	
	// Update is called once per frame
	void Update () 
	{
		if(Input.GetKeyDown(KeyCode.W))
		{
			CreateCircleObjList();
		}
	}
}
